<template>
	<view>
		<block v-for="(item, index) in listData" :key="index">
			<view class="main-box-item" @click="clickItem(item)">
				<image class="box-img" src="/static/img/icon/icon_person.png" />
				<view class="box-info">
					<view class="box-info-bottom">
						<view class="row1">
							<view class="option">
								<image class="" src="/static/img/icon/icon_captain.png" />
								{{ webUserInfo.owner.name||'' }}
							</view>
						</view>
						<view class="row2" v-if="item.devinout==1">
							<image class="" src="/static/img/icon/icon_in.png" />
							进： <uni-dateformat :date="item.brushtime"></uni-dateformat>
						</view>
						<view class="row3" v-else-if="item.devinout==0">
							<image class="" src="/static/img/icon/icon_out.png" />
							出： <uni-dateformat :date="item.brushtime"></uni-dateformat>
						</view>
						<view class="row3">
							<image class="" src="/static/img/icon/icon_local.png" />
							{{item.devname||''}}
						</view>
					</view>
				</view>
			</view>
		</block>
	</view>
</template>

<script>
	import {
		Storage_Key,
	} from '@/static/config.js';
	export default {
		components: {},
		props: ['list'], //数据数组
		data() {
			return {
				// 数据列表
				listData: this.list,
				wxUserInfo: [], //微信用户
				webUserInfo: [], //web平台用户
			}
		},
		onLoad(options) {
			this.wxUserInfo = this.$storage.get(Storage_Key.user_info, true);
		},
		watch: {
			list: {
				handler(item, index) { //监听到数据变化执行方法 
					this.webUserInfo = this.$storage.get(Storage_Key.web_user_info, true);
					this.listData = item;
				},
				deep: true // 深度监听父组件传过来对象变化 
			}
		}
	}
</script>

<style>
</style>